home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Source.bin / ImageHTMLLinkBeanInfo.java < prev    next >
Text File  |  1998-08-21  |  3KB  |  92 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.beans.*;
  4. import symantec.itools.beans.*;
  5. import java.util.ResourceBundle;
  6.  
  7. //  09/07/97    LAB    Fixed misspelling of descriptions.
  8. //  09/13/97    LAB    Removed extranious getMethodDescriptors method.
  9. //  08/19/98    LAB    Moved to GroupAWTAdditions folder.
  10.  
  11. /**
  12.  * BeanInfo for ImageHTMLLink.
  13.  *
  14.  */
  15. public class ImageHTMLLinkBeanInfo extends SimpleBeanInfo {
  16.  
  17.     /**
  18.      * Constructs a ImageHTMLLinkBeanInfo object.
  19.      */
  20.     public ImageHTMLLinkBeanInfo() {
  21.     }
  22.  
  23.     /**
  24.      * Gets a BeanInfo for the superclass of this bean.
  25.      * @return BeanInfo[] containing this bean's superclass BeanInfo
  26.      */
  27.     public BeanInfo[] getAdditionalBeanInfo() {
  28.         try {
  29.             BeanInfo[] bi = new BeanInfo[1];
  30.             bi[0] = Introspector.getBeanInfo(beanClass.getSuperclass());
  31.             return bi;
  32.         }
  33.         catch (IntrospectionException e) { throw new Error(e.toString());}
  34.     }
  35.  
  36.     /**
  37.      * Gets the SymantecBeanDescriptor for this bean.
  38.      * @return an object of type SymantecBeanDescriptor
  39.      * @see symantec.itools.beans.SymantecBeanDescriptor
  40.      */
  41.     public BeanDescriptor getBeanDescriptor() {
  42.         ResourceBundle group = ResourceBundle.getBundle("symantec.itools.resources.GroupBundle");
  43.         String s=group.getString("GroupAWTAdditions"); 
  44.  
  45.         SymantecBeanDescriptor bd = new SymantecBeanDescriptor(beanClass);
  46.         bd.setFolder(s);
  47.         bd.setWinHelp("0x123AC");
  48.  
  49.         bd.addAdditionalConnections(getAdditionalBeanInfo());
  50.  
  51.         return (BeanDescriptor) bd;
  52.     }
  53.  
  54.     /**
  55.      * Gets an image that may be used to visually represent this bean
  56.      * (in the toolbar, on a form, etc).
  57.      * @param iconKind the type of icon desired, one of: BeanInfo.ICON_MONO_16x16,
  58.      * BeanInfo.ICON_COLOR_16x16, BeanInfo.ICON_MONO_32x32, or BeanInfo.ICON_COLOR_32x32.
  59.      * @return an image for this bean, always color even if requested monochrome
  60.      * @see BeanInfo#ICON_MONO_16x16
  61.      * @see BeanInfo#ICON_COLOR_16x16
  62.      * @see BeanInfo#ICON_MONO_32x32
  63.      * @see BeanInfo#ICON_COLOR_32x32
  64.      */
  65.     public java.awt.Image getIcon(int iconKind) {
  66.         if (iconKind == BeanInfo.ICON_MONO_16x16 ||
  67.             iconKind == BeanInfo.ICON_COLOR_16x16) {
  68.             java.awt.Image img = loadImage("ImageHTMLLinkC16.gif");
  69.             return img;
  70.         }
  71.  
  72.         if (iconKind == BeanInfo.ICON_MONO_32x32 ||
  73.             iconKind == BeanInfo.ICON_COLOR_32x32) {
  74.             java.awt.Image img = loadImage("ImageHTMLLinkC32.gif");
  75.             return img;
  76.         }
  77.  
  78.         return null;
  79.     }
  80.  
  81.     public MethodDescriptor[] getMethodDescriptors() { return new MethodDescriptor[0]; }
  82.  
  83.     /**
  84.      * Returns descriptions of this bean's properties.
  85.      */
  86.     public PropertyDescriptor[] getPropertyDescriptors() {
  87.         return new PropertyDescriptor[0];   //hide this bean's properties from introspection
  88.     }
  89.  
  90.     private final static Class beanClass = ImageHTMLLink.class;
  91.  
  92.     }    //  end of class ImageHTMLLinkBeanInfo